<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>修改</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
    <link rel="stylesheet" href="../layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/shortrent.shortrent.css">
    <script type="application/javascript" src="../js/jquery-3.3.1.js"></script>
    <script type="application/javascript" src="../js/bootstrap.min.js"></script>
    <script type="application/javascript" src="../layui/layui.js"></script>
    <script type="application/javascript" src="../js/vue.min.js"></script>
</head>
<body>
      请输入新密码：<input type="text" name="password" placeholder="请输入" id="password">
      <input type="submit" value="提交" onclick="change()">
<script>
    // var user = new Vue({
    //    el:'#from_user',
    //     data:{
    //        user1
    //     }
    // });
    // $(function(){
    //     alert(1);
    //     find();
    // });
    // function find(){
    //     alert(2);
    //     var get = window.location.search;
    //     alert(get);
    //     $.ajax({
    //         type: "post",
    //         url: "/findUserEmailtwo"+get,
    //         dataType: "json",
    //         success: function (data) {
    //             console.log(data.data);
    //
    //             if (data.statusCode == 200) {
    //                 alert("c");
    //                 user.user1 = data.data;
    //             }
    //         }
    //     })
    // }
    var userlists = new Vue({
        el:'#dqsel',
        data:{
            users:''
        }
    });

    $(function(){
        alert("a");
        loadfirst();
    });

    function change(){
        var get = window.location.search;
        alert(get);
        var ema = document.getElementById("password").value;
        alert(ema);
        $.ajax({
            type: "put",
            url: "/user/updateUserPassword"+get+"&password="+ema,
            dataType: "json",
            success: function (data) {
                if (data.statusCode == 200){
                    window.location.href="login";
                }
            }
        });
    }
    /*function loadfirst() {
        var get = window.location.search;
        $.ajax({
            type: "get",
            url: "/findUserEmailtwo"+get,
            dataType: "json",
            success: function (data) {
                console.log(data);

                if (data.statusCode == 200) {
                    alert("c");
                    userlists.users = data.data;
                }
            }
        });
    }*/
</script>
</body>
</html>